package com.toocms.jinjuhang.ui.commodity.evaluate

import com.toocms.jinjuhang.R
import com.toocms.jinjuhang.BR
import com.toocms.jinjuhang.databinding.FgtCommodityEvaluateBinding
import com.toocms.jinjuhang.ui.base.BaseFgt
import com.toocms.tab.TooCMSApplication

class CommodityEvaluateFgt : BaseFgt<FgtCommodityEvaluateBinding, CommodityEvaluateModel>() {
    override fun onFragmentCreated() {
        topBar.setTitle(R.string.str_evaluate)
    }

    override fun getLayoutResId() = R.layout.fgt_commodity_evaluate

    override fun getVariableId() = BR.commodityEvaluateModel

    override fun viewObserver() {
        viewModel.stopRefreshOrLoadSingleLiveEvent.observe(this) {
            binding.refreshSrl.finishRefresh()
            binding.refreshSrl.finishLoadMore()
        }
    }

    override fun getViewModel() =
        CommodityEvaluateModel(TooCMSApplication.getInstance(), requireArguments())
}